import axios from "../utils/request";

export const $login = async function (values) {
  let { data } = await axios({
    method: "post",
    url: `/api/login?loginId=${values.loginId}&loginPwd=${values.loginPwd}`,
  });
  return data;
};
export const $adminList = async function (values) {
  let { data } = await axios.post("admin/list", values);

  return data;
};
export const $add = async function (values) {
  let { data } = await axios.post("admin/add", values);
  return data;
};
export const $getMine = async (values) => {
  let { data } = await axios.get(`admin/getMine?loginId=${values}`);
  return data;
};
export const $getOne = async (values) => {
  let { data } = await axios.get(`admin/getOne?id=${values}`);
  return data;
};
export const $update = async (values) => {
  let { data } = await axios.post("admin/update", values);
  return data;
};
export const $del = async (role) => {
  let { data } = await axios.post("admin/del", role);
  return data;
};
export const $getCheck = async (values) => {
  let { data } = await axios.get(`admin/getCheck?role=${values}`);
  return data;
};
